<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            background: #018DED
                /* url(https://unsplash.it/1500/1000?image=881&blur=5) */
            ;
            background-size: cover;
            font-size: 10px;
        }

        body {
            margin: 0;
            padding: 0;
            min-height: 100vh;
            position: relative;
        }

        .clock-body {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 30rem;
            height: 30rem;
            border: 2rem solid white;
            border-radius: 50%;
        }

        .hand {
            position: absolute;
            top: 50%;
            left: 2rem;
            width: 13rem;
            height: .3rem;
            transform: translateY(-50%);
            background: black;
            transform-origin: 100%;
        }

        .hour-hand {
            background: white;
            width: 10rem;
            margin-left: 3rem;
            /*要补全缩小的部分，不然会偏离中心点*/
        }

        .min-hand {
            background: yellow;
            width: 12rem;
            margin-left: 1rem;

        }

        .second-hand {
            background: green;
        }
    </style>
</head>

<body>
    <div class="clock-body">
        <div class="hand hour-hand"></div>
        <div class="hand min-hand"></div>
        <div class="hand second-hand"></div>
    </div>
    <script>
        const hourHand = document.querySelector(".hour-hand")
        const minHand = document.querySelector(".min-hand")
        const secondHand = document.querySelector(".second-hand")

        function setDate() {
            const now = new Date()
            const hour = now.getHours()
            const min = now.getMinutes()
            const second = now.getSeconds()
            let secondDegress = 90 + ((second / 60) * 360)
            let minDegress = 90 + ((min / 60) * 360) + ((second / 60 / 60) * 360)
            let hourDegress = 90 + ((hour / 12) * 360) + ((min / 12 / 60) * 360)
            secondHand.style.transform = `rotate(${secondDegress}deg)`
            minHand.style.transform = `rotate(${minDegress}deg)`
            hourHand.style.transform = `rotate(${hourDegress}deg)`
        }
        setDate()
        setInterval(setDate, 1000)
    </script>
</body>

</html>